package com.ljh.controller;

import com.ljh.entity.Account;
import com.ljh.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("account")
public class AccountController {
    @Autowired
    private AccountService accountService;

    @GetMapping("{id}")
    @ResponseBody
    public Account queryById(@PathVariable("id") Integer id){
        Account account = accountService.queryById(id);
        return account;
    }
}
